package main

import "fmt"

type person1 struct {
	id int
	name string
	age int
	sex string
}

type student1 struct {
	*person1 // 指针作为匿名字段
	name string
	class int
	score int
}

func main() {
	var stu student1
	stu.class = 301
	//stu.person1 = new(person1)
	stu.person1 = &person1{1001,"盖伦",30,"男"}
	stu.sex = "男"
	stu.name = "盖伦"
	stu.id = 1
	stu.age = 30
	fmt.Println(stu)
}

